import Vue from 'vue'
import VueRouter from 'vue-router'
import Movie from '../views/Movie.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect:'/movie'
  },
  {
    path: '/movie',
    name: 'Movie',
    component: Movie
  },
  {
    path: '/video',
    name: 'Video',
    component: () => import('../views/Video.vue')
  },
  {
    path: '/smallvideo',
    name: 'Smallvideo',
    component: () => import('../views/Smallvideo.vue')
  },
  {
    path: '/show',
    name: 'Show',
    component: () => import('../views/Show.vue')
  },
  {
    path: '/my',
    name: 'My',
    component: () => import('../views/My.vue')
  },
  {
    path: '/moviedetial/:movieId',
    name: 'Moviedetial',
    props:true,
    meta:{
      hideNav:true
    },
    component: () => import('../views/Moviedetial.vue')
  },
  {
    path: '/cinemadetial/:cinemaId',
    name: 'Cinemadetial',
    props:true,
    meta:{
      hideNav:true
    },
    component: () => import('../views/Cinemadetial.vue')
  },
  {
    path: '/mtrade/:movieId',
    name: 'Mtrade',
    props:true,
    meta:{
      hideNav:true
    },
    component: () => import('../views/Mtrade.vue')
  },
  {
    path: '/feeddetial/:movieId/:feedId',
    name: 'Feeddetial',
    props:true,
    meta:{
      hideNav:true
    },
    component: () => import('../views/Feeddetial.vue')
  },
  {
    path: '/city',
    name: 'City',
    meta:{
      hideNav:true
    },
    component: () => import('../views/City.vue')
  },
  {
    path: '/xiaoDetial',
    name: 'XiaoDetail',
    props:true,
    meta:{
      hideNav:true
    },
    component: () => import('../views/XiaoDetail.vue')
  },
  {
    path: '/buyticket',
    name: 'Buyticket',
    props:function(route){
      return {
        cinema:route.params.cinema,
        lis:route.params.lis,
        movie:route.params.movie,
      }
    },
    // props:true,
    meta:{
      hideNav:true
    },
    component: () => import('../views/Buyticket.vue')
  },
]

const router = new VueRouter({
  routes
})

export default router
